package com.hy.movie.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class HttpConfig {
    @Value("${receive.address}")
    private String address;
    @Value("${receive.isSSL}")
    private Boolean isSSL;

    public String getHttpUrl(){
        StringBuilder stringBuilder = new StringBuilder();
        if (isSSL) {
            stringBuilder.append("https://");
        } else {
            stringBuilder.append("http://");
        }
        stringBuilder.append(address);
        return stringBuilder.toString();
    }
}
